home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_elisp-manual-21.idb / usr / freeware / info / elisp-29.z / elisp-29
Text File  |  2002-07-08  |  51KB  |  1,168 lines

  1. This is elisp, produced by makeinfo version 4.0f from ./elisp.texi.
  2.  
  3. INFO-DIR-SECTION Editors
  4. START-INFO-DIR-ENTRY
  5. * Elisp: (elisp).    The Emacs Lisp Reference Manual.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This Info file contains edition 2.8 of the GNU Emacs Lisp Reference
  9. Manual, corresponding to Emacs version 21.2.
  10.  
  11.    Published by the Free Software Foundation 59 Temple Place, Suite 330
  12. Boston, MA  02111-1307  USA
  13.  
  14.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
  15. 2000, 2001, 2002 Free Software Foundation, Inc.
  16.  
  17.    Permission is granted to copy, distribute and/or modify this document
  18. under the terms of the GNU Free Documentation License, Version 1.1 or
  19. any later version published by the Free Software Foundation; with the
  20. Invariant Sections being "Copying", with the Front-Cover texts being "A
  21. GNU Manual", and with the Back-Cover Texts as in (a) below.  A copy of
  22. the license is included in the section entitled "GNU Free Documentation
  23. License".
  24.  
  25.    (a) The FSF's Back-Cover Text is: "You have freedom to copy and
  26. modify this GNU Manual, like GNU software.  Copies published by the Free
  27. Software Foundation raise funds for GNU development."
  28.  
  29. 
  30. File: elisp,  Node: Input Focus,  Next: Visibility of Frames,  Prev: Minibuffers and Frames,  Up: Frames
  31.  
  32. Input Focus
  33. ===========
  34.  
  35.    At any time, one frame in Emacs is the "selected frame".  The
  36. selected window always resides on the selected frame.
  37.  
  38.    When Emacs displays its frames on several terminals (*note Multiple
  39. Displays::), each terminal has its own selected frame.  But only one of
  40. these is "_the_ selected frame": it's the frame that belongs to the
  41. terminal from which the most recent input came.  That is, when Emacs
  42. runs a command that came from a certain terminal, the selected frame is
  43. the one of that terminal.  Since Emacs runs only a single command at any
  44. given time, it needs to consider only one selected frame at a time; this
  45. frame is what we call "the selected frame" in this manual.  The display
  46. on which the selected frame is displayed is the "selected frame's
  47. display".
  48.  
  49.  - Function: selected-frame
  50.      This function returns the selected frame.
  51.  
  52.    Some window systems and window managers direct keyboard input to the
  53. window object that the mouse is in; others require explicit clicks or
  54. commands to "shift the focus" to various window objects.  Either way,
  55. Emacs automatically keeps track of which frame has the focus.
  56.  
  57.    Lisp programs can also switch frames "temporarily" by calling the
  58. function `select-frame'.  This does not alter the window system's
  59. concept of focus; rather, it escapes from the window manager's control
  60. until that control is somehow reasserted.
  61.  
  62.    When using a text-only terminal, only the selected terminal frame is
  63. actually displayed on the terminal.  `switch-frame' is the only way to
  64. switch frames, and the change lasts until overridden by a subsequent
  65. call to `switch-frame'.  Each terminal screen except for the initial
  66. one has a number, and the number of the selected frame appears in the
  67. mode line before the buffer name (*note Mode Line Variables::).
  68.  
  69.  - Function: select-frame frame
  70.      This function selects frame FRAME, temporarily disregarding the
  71.      focus of the X server if any.  The selection of FRAME lasts until
  72.      the next time the user does something to select a different frame,
  73.      or until the next time this function is called.  The specified
  74.      FRAME becomes the selected frame, as explained above, and the
  75.      terminal that FRAME is on becomes the selected terminal.
  76.  
  77.      In general, you should never use `select-frame' in a way that could
  78.      switch to a different terminal without switching back when you're
  79.      done.
  80.  
  81.    Emacs cooperates with the window system by arranging to select
  82. frames as the server and window manager request.  It does so by
  83. generating a special kind of input event, called a "focus" event, when
  84. appropriate.  The command loop handles a focus event by calling
  85. `handle-switch-frame'.  *Note Focus Events::.
  86.  
  87.  - Command: handle-switch-frame frame
  88.      This function handles a focus event by selecting frame FRAME.
  89.  
  90.      Focus events normally do their job by invoking this command.
  91.      Don't call it for any other reason.
  92.  
  93.  - Function: redirect-frame-focus frame focus-frame
  94.      This function redirects focus from FRAME to FOCUS-FRAME.  This
  95.      means that FOCUS-FRAME will receive subsequent keystrokes and
  96.      events intended for FRAME.  After such an event, the value of
  97.      `last-event-frame' will be FOCUS-FRAME.  Also, switch-frame events
  98.      specifying FRAME will instead select FOCUS-FRAME.
  99.  
  100.      If FOCUS-FRAME is `nil', that cancels any existing redirection for
  101.      FRAME, which therefore once again receives its own events.
  102.  
  103.      One use of focus redirection is for frames that don't have
  104.      minibuffers.  These frames use minibuffers on other frames.
  105.      Activating a minibuffer on another frame redirects focus to that
  106.      frame.  This puts the focus on the minibuffer's frame, where it
  107.      belongs, even though the mouse remains in the frame that activated
  108.      the minibuffer.
  109.  
  110.      Selecting a frame can also change focus redirections.  Selecting
  111.      frame `bar', when `foo' had been selected, changes any redirections
  112.      pointing to `foo' so that they point to `bar' instead.  This
  113.      allows focus redirection to work properly when the user switches
  114.      from one frame to another using `select-window'.
  115.  
  116.      This means that a frame whose focus is redirected to itself is
  117.      treated differently from a frame whose focus is not redirected.
  118.      `select-frame' affects the former but not the latter.
  119.  
  120.      The redirection lasts until `redirect-frame-focus' is called to
  121.      change it.
  122.  
  123.  - User Option: focus-follows-mouse
  124.      This option is how you inform Emacs whether the window manager
  125.      transfers focus when the user moves the mouse.  Non-`nil' says
  126.      that it does.  When this is so, the command `other-frame' moves
  127.      the mouse to a position consistent with the new selected frame.
  128.  
  129. 
  130. File: elisp,  Node: Visibility of Frames,  Next: Raising and Lowering,  Prev: Input Focus,  Up: Frames
  131.  
  132. Visibility of Frames
  133. ====================
  134.  
  135.    A window frame may be "visible", "invisible", or "iconified".  If it
  136. is visible, you can see its contents.  If it is iconified, the frame's
  137. contents do not appear on the screen, but an icon does.  If the frame
  138. is invisible, it doesn't show on the screen, not even as an icon.
  139.  
  140.    Visibility is meaningless for terminal frames, since only the
  141. selected one is actually displayed in any case.
  142.  
  143.  - Command: make-frame-visible &optional frame
  144.      This function makes frame FRAME visible.  If you omit FRAME, it
  145.      makes the selected frame visible.
  146.  
  147.  - Command: make-frame-invisible &optional frame
  148.      This function makes frame FRAME invisible.  If you omit FRAME, it
  149.      makes the selected frame invisible.
  150.  
  151.  - Command: iconify-frame &optional frame
  152.      This function iconifies frame FRAME.  If you omit FRAME, it
  153.      iconifies the selected frame.
  154.  
  155.  - Function: frame-visible-p frame
  156.      This returns the visibility status of frame FRAME.  The value is
  157.      `t' if FRAME is visible, `nil' if it is invisible, and `icon' if
  158.      it is iconified.
  159.  
  160.    The visibility status of a frame is also available as a frame
  161. parameter.  You can read or change it as such.  *Note Window Frame
  162. Parameters::.
  163.  
  164.    The user can iconify and deiconify frames with the window manager.
  165. This happens below the level at which Emacs can exert any control, but
  166. Emacs does provide events that you can use to keep track of such
  167. changes.  *Note Misc Events::.
  168.  
  169. 
  170. File: elisp,  Node: Raising and Lowering,  Next: Frame Configurations,  Prev: Visibility of Frames,  Up: Frames
  171.  
  172. Raising and Lowering Frames
  173. ===========================
  174.  
  175.    Most window systems use a desktop metaphor.  Part of this metaphor is
  176. the idea that windows are stacked in a notional third dimension
  177. perpendicular to the screen surface, and thus ordered from "highest" to
  178. "lowest".  Where two windows overlap, the one higher up covers the one
  179. underneath.  Even a window at the bottom of the stack can be seen if no
  180. other window overlaps it.
  181.  
  182.    A window's place in this ordering is not fixed; in fact, users tend
  183. to change the order frequently.  "Raising" a window means moving it
  184. "up", to the top of the stack.  "Lowering" a window means moving it to
  185. the bottom of the stack.  This motion is in the notional third
  186. dimension only, and does not change the position of the window on the
  187. screen.
  188.  
  189.    You can raise and lower Emacs frame Windows with these functions:
  190.  
  191.  - Command: raise-frame &optional frame
  192.      This function raises frame FRAME (default, the selected frame).
  193.  
  194.  - Command: lower-frame &optional frame
  195.      This function lowers frame FRAME (default, the selected frame).
  196.  
  197.  - User Option: minibuffer-auto-raise
  198.      If this is non-`nil', activation of the minibuffer raises the frame
  199.      that the minibuffer window is in.
  200.  
  201.    You can also enable auto-raise (raising automatically when a frame is
  202. selected) or auto-lower (lowering automatically when it is deselected)
  203. for any frame using frame parameters.  *Note Window Frame Parameters::.
  204.  
  205. 
  206. File: elisp,  Node: Frame Configurations,  Next: Mouse Tracking,  Prev: Raising and Lowering,  Up: Frames
  207.  
  208. Frame Configurations
  209. ====================
  210.  
  211.    A "frame configuration" records the current arrangement of frames,
  212. all their properties, and the window configuration of each one.  (*Note
  213. Window Configurations::.)
  214.  
  215.  - Function: current-frame-configuration
  216.      This function returns a frame configuration list that describes
  217.      the current arrangement of frames and their contents.
  218.  
  219.  - Function: set-frame-configuration configuration &optional nodelete
  220.      This function restores the state of frames described in
  221.      CONFIGURATION.
  222.  
  223.      Ordinarily, this function deletes all existing frames not listed in
  224.      CONFIGURATION.  But if NODELETE is non-`nil', the unwanted frames
  225.      are iconified instead.
  226.  
  227. 
  228. File: elisp,  Node: Mouse Tracking,  Next: Mouse Position,  Prev: Frame Configurations,  Up: Frames
  229.  
  230. Mouse Tracking
  231. ==============
  232.  
  233.    Sometimes it is useful to "track" the mouse, which means to display
  234. something to indicate where the mouse is and move the indicator as the
  235. mouse moves.  For efficient mouse tracking, you need a way to wait until
  236. the mouse actually moves.
  237.  
  238.    The convenient way to track the mouse is to ask for events to
  239. represent mouse motion.  Then you can wait for motion by waiting for an
  240. event.  In addition, you can easily handle any other sorts of events
  241. that may occur.  That is useful, because normally you don't want to
  242. track the mouse forever--only until some other event, such as the
  243. release of a button.
  244.  
  245.  - Special Form: track-mouse body...
  246.      This special form executes BODY, with generation of mouse motion
  247.      events enabled.  Typically BODY would use `read-event' to read the
  248.      motion events and modify the display accordingly.  *Note Motion
  249.      Events::, for the format of mouse motion events.
  250.  
  251.      The value of `track-mouse' is that of the last form in BODY.  You
  252.      should design BODY to return when it sees the up-event that
  253.      indicates the release of the button, or whatever kind of event
  254.      means it is time to stop tracking.
  255.  
  256.    The usual purpose of tracking mouse motion is to indicate on the
  257. screen the consequences of pushing or releasing a button at the current
  258. position.
  259.  
  260.    In many cases, you can avoid the need to track the mouse by using
  261. the `mouse-face' text property (*note Special Properties::).  That
  262. works at a much lower level and runs more smoothly than Lisp-level
  263. mouse tracking.
  264.  
  265. 
  266. File: elisp,  Node: Mouse Position,  Next: Pop-Up Menus,  Prev: Mouse Tracking,  Up: Frames
  267.  
  268. Mouse Position
  269. ==============
  270.  
  271.    The functions `mouse-position' and `set-mouse-position' give access
  272. to the current position of the mouse.
  273.  
  274.  - Function: mouse-position
  275.      This function returns a description of the position of the mouse.
  276.      The value looks like `(FRAME X . Y)', where X and Y are integers
  277.      giving the position in characters relative to the top left corner
  278.      of the inside of FRAME.
  279.  
  280.  - Variable: mouse-position-function
  281.      If non-`nil', the value of this variable is a function for
  282.      `mouse-position' to call.  `mouse-position' calls this function
  283.      just before returning, with its normal return value as the sole
  284.      argument, and it returns whatever this function returns to it.
  285.  
  286.      This abnormal hook exists for the benefit of packages like
  287.      `xt-mouse.el' that need to do mouse handling at the Lisp level.
  288.  
  289.  - Function: set-mouse-position frame x y
  290.      This function "warps the mouse" to position X, Y in frame FRAME.
  291.      The arguments X and Y are integers, giving the position in
  292.      characters relative to the top left corner of the inside of FRAME.
  293.      If FRAME is not visible, this function does nothing.  The return
  294.      value is not significant.
  295.  
  296.  - Function: mouse-pixel-position
  297.      This function is like `mouse-position' except that it returns
  298.      coordinates in units of pixels rather than units of characters.
  299.  
  300.  - Function: set-mouse-pixel-position frame x y
  301.      This function warps the mouse like `set-mouse-position' except that
  302.      X and Y are in units of pixels rather than units of characters.
  303.      These coordinates are not required to be within the frame.
  304.  
  305.      If FRAME is not visible, this function does nothing.  The return
  306.      value is not significant.
  307.  
  308. 
  309. File: elisp,  Node: Pop-Up Menus,  Next: Dialog Boxes,  Prev: Mouse Position,  Up: Frames
  310.  
  311. Pop-Up Menus
  312. ============
  313.  
  314.    When using a window system, a Lisp program can pop up a menu so that
  315. the user can choose an alternative with the mouse.
  316.  
  317.  - Function: x-popup-menu position menu
  318.      This function displays a pop-up menu and returns an indication of
  319.      what selection the user makes.
  320.  
  321.      The argument POSITION specifies where on the screen to put the
  322.      menu.  It can be either a mouse button event (which says to put
  323.      the menu where the user actuated the button) or a list of this
  324.      form:
  325.  
  326.           ((XOFFSET YOFFSET) WINDOW)
  327.  
  328.      where XOFFSET and YOFFSET are coordinates, measured in pixels,
  329.      counting from the top left corner of WINDOW's frame.
  330.  
  331.      If POSITION is `t', it means to use the current mouse position.
  332.      If POSITION is `nil', it means to precompute the key binding
  333.      equivalents for the keymaps specified in MENU, without actually
  334.      displaying or popping up the menu.
  335.  
  336.      The argument MENU says what to display in the menu.  It can be a
  337.      keymap or a list of keymaps (*note Menu Keymaps::).
  338.      Alternatively, it can have the following form:
  339.  
  340.           (TITLE PANE1 PANE2...)
  341.  
  342.      where each pane is a list of form
  343.  
  344.           (TITLE (LINE . ITEM)...)
  345.  
  346.      Each LINE should be a string, and each ITEM should be the value to
  347.      return if that LINE is chosen.
  348.  
  349.    *Usage note:* Don't use `x-popup-menu' to display a menu if you
  350. could do the job with a prefix key defined with a menu keymap.  If you
  351. use a menu keymap to implement a menu, `C-h c' and `C-h a' can see the
  352. individual items in that menu and provide help for them.  If instead
  353. you implement the menu by defining a command that calls `x-popup-menu',
  354. the help facilities cannot know what happens inside that command, so
  355. they cannot give any help for the menu's items.
  356.  
  357.    The menu bar mechanism, which lets you switch between submenus by
  358. moving the mouse, cannot look within the definition of a command to see
  359. that it calls `x-popup-menu'.  Therefore, if you try to implement a
  360. submenu using `x-popup-menu', it cannot work with the menu bar in an
  361. integrated fashion.  This is why all menu bar submenus are implemented
  362. with menu keymaps within the parent menu, and never with
  363. `x-popup-menu'.  *Note Menu Bar::,
  364.  
  365.    If you want a menu bar submenu to have contents that vary, you should
  366. still use a menu keymap to implement it.  To make the contents vary, add
  367. a hook function to `menu-bar-update-hook' to update the contents of the
  368. menu keymap as necessary.
  369.  
  370. 
  371. File: elisp,  Node: Dialog Boxes,  Next: Pointer Shapes,  Prev: Pop-Up Menus,  Up: Frames
  372.  
  373. Dialog Boxes
  374. ============
  375.  
  376.    A dialog box is a variant of a pop-up menu--it looks a little
  377. different, it always appears in the center of a frame, and it has just
  378. one level and one pane.  The main use of dialog boxes is for asking
  379. questions that the user can answer with "yes", "no", and a few other
  380. alternatives.  The functions `y-or-n-p' and `yes-or-no-p' use dialog
  381. boxes instead of the keyboard, when called from commands invoked by
  382. mouse clicks.
  383.  
  384.  - Function: x-popup-dialog position contents
  385.      This function displays a pop-up dialog box and returns an
  386.      indication of what selection the user makes.  The argument
  387.      CONTENTS specifies the alternatives to offer; it has this format:
  388.  
  389.           (TITLE (STRING . VALUE)...)
  390.  
  391.      which looks like the list that specifies a single pane for
  392.      `x-popup-menu'.
  393.  
  394.      The return value is VALUE from the chosen alternative.
  395.  
  396.      An element of the list may be just a string instead of a cons cell
  397.      `(STRING . VALUE)'.  That makes a box that cannot be selected.
  398.  
  399.      If `nil' appears in the list, it separates the left-hand items from
  400.      the right-hand items; items that precede the `nil' appear on the
  401.      left, and items that follow the `nil' appear on the right.  If you
  402.      don't include a `nil' in the list, then approximately half the
  403.      items appear on each side.
  404.  
  405.      Dialog boxes always appear in the center of a frame; the argument
  406.      POSITION specifies which frame.  The possible values are as in
  407.      `x-popup-menu', but the precise coordinates don't matter; only the
  408.      frame matters.
  409.  
  410.      In some configurations, Emacs cannot display a real dialog box; so
  411.      instead it displays the same items in a pop-up menu in the center
  412.      of the frame.
  413.  
  414. 
  415. File: elisp,  Node: Pointer Shapes,  Next: Window System Selections,  Prev: Dialog Boxes,  Up: Frames
  416.  
  417. Pointer Shapes
  418. ==============
  419.  
  420.    These variables specify which shape to use for the mouse pointer in
  421. various situations, when using the X Window System:
  422.  
  423. `x-pointer-shape'
  424.      This variable specifies the pointer shape to use ordinarily in the
  425.      Emacs frame.
  426.  
  427. `x-sensitive-text-pointer-shape'
  428.      This variable specifies the pointer shape to use when the mouse is
  429.      over mouse-sensitive text.
  430.  
  431.    These variables affect newly created frames.  They do not normally
  432. affect existing frames; however, if you set the mouse color of a frame,
  433. that also updates its pointer shapes based on the current values of
  434. these variables.  *Note Window Frame Parameters::.
  435.  
  436.    The values you can use, to specify either of these pointer shapes,
  437. are defined in the file `lisp/term/x-win.el'.  Use `M-x apropos <RET>
  438. x-pointer <RET>' to see a list of them.
  439.  
  440. 
  441. File: elisp,  Node: Window System Selections,  Next: Color Names,  Prev: Pointer Shapes,  Up: Frames
  442.  
  443. Window System Selections
  444. ========================
  445.  
  446.    The X server records a set of "selections" which permit transfer of
  447. data between application programs.  The various selections are
  448. distinguished by "selection types", represented in Emacs by symbols.  X
  449. clients including Emacs can read or set the selection for any given
  450. type.
  451.  
  452.  - Function: x-set-selection type data
  453.      This function sets a "selection" in the X server.  It takes two
  454.      arguments: a selection type TYPE, and the value to assign to it,
  455.      DATA.  If DATA is `nil', it means to clear out the selection.
  456.      Otherwise, DATA may be a string, a symbol, an integer (or a cons
  457.      of two integers or list of two integers), an overlay, or a cons of
  458.      two markers pointing to the same buffer.  An overlay or a pair of
  459.      markers stands for text in the overlay or between the markers.
  460.  
  461.      The argument DATA may also be a vector of valid non-vector
  462.      selection values.
  463.  
  464.      Each possible TYPE has its own selection value, which changes
  465.      independently.  The usual values of TYPE are `PRIMARY' and
  466.      `SECONDARY'; these are symbols with upper-case names, in accord
  467.      with X Window System conventions.  The default is `PRIMARY'.
  468.  
  469.  - Function: x-get-selection &optional type data-type
  470.      This function accesses selections set up by Emacs or by other X
  471.      clients.  It takes two optional arguments, TYPE and DATA-TYPE.
  472.      The default for TYPE, the selection type, is `PRIMARY'.
  473.  
  474.      The DATA-TYPE argument specifies the form of data conversion to
  475.      use, to convert the raw data obtained from another X client into
  476.      Lisp data.  Meaningful values include `TEXT', `STRING', `TARGETS',
  477.      `LENGTH', `DELETE', `FILE_NAME', `CHARACTER_POSITION',
  478.      `LINE_NUMBER', `COLUMN_NUMBER', `OWNER_OS', `HOST_NAME', `USER',
  479.      `CLASS', `NAME', `ATOM', and `INTEGER'.  (These are symbols with
  480.      upper-case names in accord with X conventions.)  The default for
  481.      DATA-TYPE is `STRING'.
  482.  
  483.    The X server also has a set of numbered "cut buffers" which can
  484. store text or other data being moved between applications.  Cut buffers
  485. are considered obsolete, but Emacs supports them for the sake of X
  486. clients that still use them.
  487.  
  488.  - Function: x-get-cut-buffer n
  489.      This function returns the contents of cut buffer number N.
  490.  
  491.  - Function: x-set-cut-buffer string &optional push
  492.      This function stores STRING into the first cut buffer (cut buffer
  493.      0).  If PUSH is `nil', only the first cut buffer is changed.  If
  494.      PUSH is non-`nil', that says to move the values down through the
  495.      series of cut buffers, much like the way successive kills in Emacs
  496.      move down the kill ring.  In other words, the previous value of
  497.      the first cut buffer moves into the second cut buffer, and the
  498.      second to the third, and so on through all eight cut buffers.
  499.  
  500.  - Variable: selection-coding-system
  501.      This variable specifies the coding system to use when reading and
  502.      writing selections, the clipboard, or a cut buffer.  *Note Coding
  503.      Systems::.  The default is `compound-text', which converts to the
  504.      text representation that X11 normally uses.
  505.  
  506.    When Emacs runs on MS-Windows, it does not implement X selections in
  507. general, but it does support the clipboard.  `x-get-selection' and
  508. `x-set-selection' on MS-Windows support the text data type only; if the
  509. clipboard holds other types of data, Emacs treats the clipboard as
  510. empty.
  511.  
  512.  - User Option: x-select-enable-clipboard
  513.      If this is non-`nil', the Emacs yank functions consult the
  514.      clipboard before the primary selection, and the kill functions
  515.      store in the clipboard as well as the primary selection.
  516.      Otherwise they do not access the clipboard at all.  The default is
  517.      `nil' on most systems, but `t' on MS-Windows.
  518.  
  519. 
  520. File: elisp,  Node: Color Names,  Next: Text Terminal Colors,  Prev: Window System Selections,  Up: Frames
  521.  
  522. Color Names
  523. ===========
  524.  
  525.    These functions provide a way to determine which color names are
  526. valid, and what they look like.  In some cases, the value depends on the
  527. "selected frame", as described below; see *Note Input Focus::, for the
  528. meaning of the term "selected frame".
  529.  
  530.  - Function: color-defined-p color &optional frame
  531.      This function reports whether a color name is meaningful.  It
  532.      returns `t' if so; otherwise, `nil'.  The argument FRAME says
  533.      which frame's display to ask about; if FRAME is omitted or `nil',
  534.      the selected frame is used.
  535.  
  536.      Note that this does not tell you whether the display you are using
  537.      really supports that color.  When using X, you can ask for any
  538.      defined color on any kind of display, and you will get some
  539.      result--typically, the closest it can do.  To determine whether a
  540.      frame can really display a certain color, use `color-supported-p'
  541.      (see below).
  542.  
  543.      This function used to be called `x-color-defined-p', and that name
  544.      is still supported as an alias.
  545.  
  546.  - Function: defined-colors &optional frame
  547.      This function returns a list of the color names that are defined
  548.      and supported on frame FRAME (default, the selected frame).
  549.  
  550.      This function used to be called `x-defined-colors', and that name
  551.      is still supported as an alias.
  552.  
  553.  - Function: color-supported-p color &optional frame background-p
  554.      This returns `t' if FRAME can really display the color COLOR (or
  555.      at least something close to it).  If FRAME is omitted or `nil',
  556.      the question applies to the selected frame.
  557.  
  558.      Some terminals support a different set of colors for foreground and
  559.      background.  If BACKGROUND-P is non-`nil', that means you are
  560.      asking whether COLOR can be used as a background; otherwise you
  561.      are asking whether it can be used as a foreground.
  562.  
  563.      The argument COLOR must be a valid color name.
  564.  
  565.  - Function: color-gray-p color &optional frame
  566.      This returns `t' if COLOR is a shade of gray, as defined on
  567.      FRAME's display.  If FRAME is omitted or `nil', the question
  568.      applies to the selected frame.  The argument COLOR must be a valid
  569.      color name.
  570.  
  571.  - Function: color-values color &optional frame
  572.      This function returns a value that describes what COLOR should
  573.      ideally look like.  If COLOR is defined, the value is a list of
  574.      three integers, which give the amount of red, the amount of green,
  575.      and the amount of blue.  Each integer ranges in principle from 0
  576.      to 65535, but in practice no value seems to be above 65280.  This
  577.      kind of three-element list is called an "rgb value".
  578.  
  579.      If COLOR is not defined, the value is `nil'.
  580.  
  581.           (color-values "black")
  582.                => (0 0 0)
  583.           (color-values "white")
  584.                => (65280 65280 65280)
  585.           (color-values "red")
  586.                => (65280 0 0)
  587.           (color-values "pink")
  588.                => (65280 49152 51968)
  589.           (color-values "hungry")
  590.                => nil
  591.  
  592.      The color values are returned for FRAME's display.  If FRAME is
  593.      omitted or `nil', the information is returned for the selected
  594.      frame's display.
  595.  
  596.      This function used to be called `x-color-values', and that name is
  597.      still supported as an alias.
  598.  
  599. 
  600. File: elisp,  Node: Text Terminal Colors,  Next: Resources,  Prev: Color Names,  Up: Frames
  601.  
  602. Text Terminal Colors
  603. ====================
  604.  
  605.    Emacs can display color on text-only terminals, starting with version
  606. 21.  These terminals support only a small number of colors, and the
  607. computer uses small integers to select colors on the terminal.  This
  608. means that the computer cannot reliably tell what the selected color
  609. looks like; instead, you have to inform your application which small
  610. integers correspond to which colors.  However, Emacs does know the
  611. standard set of colors and will try to use them automatically.
  612.  
  613.    Several of these functions use or return "rgb values".  An rgb value
  614. is a list of three integers, which give the amount of red, the amount
  615. of green, and the amount of blue.  Each integer ranges in principle
  616. from 0 to 65535, but in practice the largest value used is 65280.
  617.  
  618.    These functions accept a display (either a frame or the name of a
  619. terminal) as an optional argument.  We hope in the future to make Emacs
  620. support more than one text-only terminal at one time; then this argument
  621. will specify which terminal to operate on (the default being the
  622. selected frame's terminal; *note Input Focus::).  At present, though,
  623. the DISPLAY argument has no effect.
  624.  
  625.  - Function: tty-color-define name number &optional rgb display
  626.      This function associates the color name NAME with color number
  627.      NUMBER on the terminal.
  628.  
  629.      The optional argument RGB, if specified, is an rgb value; it says
  630.      what the color actually looks like.  If you do not specify RGB,
  631.      then this color cannot be used by `tty-color-approximate' to
  632.      approximate other colors, because Emacs does not know what it looks
  633.      like.
  634.  
  635.  - Function: tty-color-clear &optional display
  636.      This function clears the table of defined colors for a text-only
  637.      terminal.
  638.  
  639.  - Function: tty-color-alist &optional display
  640.      This function returns an alist recording the known colors
  641.      supported by a text-only terminal.
  642.  
  643.      Each element has the form `(NAME NUMBER . RGB)' or `(NAME
  644.      NUMBER)'.  Here, NAME is the color name, NUMBER is the number used
  645.      to specify it to the terminal.  If present, RGB is an rgb value
  646.      that says what the color actually looks like.
  647.  
  648.  - Function: tty-color-approximate rgb &optional display
  649.      This function finds the closest color, among the known colors
  650.      supported for DISPLAY, to that described by the rgb value RGB.
  651.  
  652.  - Function: tty-color-translate color &optional display
  653.      This function finds the closest color to COLOR among the known
  654.      colors supported for DISPLAY.  If the name COLOR is not defined,
  655.      the value is `nil'.
  656.  
  657.      COLOR can be an X-style `"#XXXYYYZZZ"' specification instead of an
  658.      actual name.  The format `"RGB:XX/YY/ZZ"' is also supported.
  659.  
  660. 
  661. File: elisp,  Node: Resources,  Next: Display Feature Testing,  Prev: Text Terminal Colors,  Up: Frames
  662.  
  663. X Resources
  664. ===========
  665.  
  666.  - Function: x-get-resource attribute class &optional component subclass
  667.      The function `x-get-resource' retrieves a resource value from the X
  668.      Windows defaults database.
  669.  
  670.      Resources are indexed by a combination of a "key" and a "class".
  671.      This function searches using a key of the form
  672.      `INSTANCE.ATTRIBUTE' (where INSTANCE is the name under which Emacs
  673.      was invoked), and using `Emacs.CLASS' as the class.
  674.  
  675.      The optional arguments COMPONENT and SUBCLASS add to the key and
  676.      the class, respectively.  You must specify both of them or neither.
  677.      If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE',
  678.      and the class is `Emacs.CLASS.SUBCLASS'.
  679.  
  680.  - Variable: x-resource-class
  681.      This variable specifies the application name that `x-get-resource'
  682.      should look up.  The default value is `"Emacs"'.  You can examine X
  683.      resources for application names other than "Emacs" by binding this
  684.      variable to some other string, around a call to `x-get-resource'.
  685.  
  686.    *Note X Resources: (emacs)Resources X.
  687.  
  688. 
  689. File: elisp,  Node: Display Feature Testing,  Prev: Resources,  Up: Frames
  690.  
  691. Display Feature Testing
  692. =======================
  693.  
  694.    The functions in this section describe the basic capabilities of a
  695. particular display.  Lisp programs can use them to adapt their behavior
  696. to what the display can do.  For example, a program that ordinarly uses
  697. a popup menu could use the minibuffer if popup menus are not supported.
  698.  
  699.    The optional argument DISPLAY in these functions specifies which
  700. display to ask the question about.  It can be a display name, a frame
  701. (which designates the display that frame is on), or `nil' (which refers
  702. to the selected frame's display, *note Input Focus::).
  703.  
  704.    *Note Color Names::, *Note Text Terminal Colors::, for other
  705. functions to obtain information about displays.
  706.  
  707.  - Function: display-popup-menus-p &optional display
  708.      This function returns `t' if popup menus are supported on DISPLAY,
  709.      `nil' if not.  Support for popup menus requires that the mouse be
  710.      available, since the user cannot choose menu items without a mouse.
  711.  
  712.  - Function: display-graphic-p &optional display
  713.      This function returns `t' if DISPLAY is a graphic display capable
  714.      of displaying several frames and several different fonts at once.
  715.      This is true for displays that use a window system such as X, and
  716.      false for text-only terminals.
  717.  
  718.  - Function: display-mouse-p &optional display
  719.      This function returns `t' if DISPLAY has a mouse available, `nil'
  720.      if not.
  721.  
  722.  - Function: display-color-p &optional display
  723.      This function returns `t' if the screen is a color screen.  It
  724.      used to be called `x-display-color-p', and that name is still
  725.      supported as an alias.
  726.  
  727.  - Function: display-grayscale-p &optional display
  728.      This function returns `t' if the screen can display shades of gray.
  729.      (All color displays can do this.)
  730.  
  731.  - Function: display-selections-p &optional display
  732.      This function returns `t' if DISPLAY supports selections.
  733.      Windowed displays normally support selections, but they may also be
  734.      supported in some other cases.
  735.  
  736.  - Function: display-images-p &optional display
  737.      This function returns `t' if DISPLAY can display images.  Windowed
  738.      displays ought in principle to handle images, but some systems
  739.      lack the support for that.  On a display that does not support
  740.      images, Emacs cannot display a tool bar.
  741.  
  742.  - Function: display-screens &optional display
  743.      This function returns the number of screens associated with the
  744.      display.
  745.  
  746.  - Function: display-pixel-height &optional display
  747.      This function returns the height of the screen in pixels.
  748.  
  749.  - Function: display-mm-height &optional display
  750.      This function returns the height of the screen in millimeters, or
  751.      `nil' if Emacs cannot get that information.
  752.  
  753.  - Function: display-pixel-width &optional display
  754.      This function returns the width of the screen in pixels.
  755.  
  756.  - Function: display-mm-width &optional display
  757.      This function returns the width of the screen in millimeters, or
  758.      `nil' if Emacs cannot get that information.
  759.  
  760.  - Function: display-backing-store &optional display
  761.      This function returns the backing store capability of the display.
  762.      Backing store means recording the pixels of windows (and parts of
  763.      windows) that are not exposed, so that when exposed they can be
  764.      displayed very quickly.
  765.  
  766.      Values can be the symbols `always', `when-mapped', or
  767.      `not-useful'.  The function can also return `nil' when the
  768.      question is inapplicable to a certain kind of display.
  769.  
  770.  - Function: display-save-under &optional display
  771.      This function returns non-`nil' if the display supports the
  772.      SaveUnder feature.  That feature is used by pop-up windows to save
  773.      the pixels they obscure, so that they can pop down quickly.
  774.  
  775.  - Function: display-planes &optional display
  776.      This function returns the number of planes the display supports.
  777.      This is typically the number of bits per pixel.  For a tty
  778.      display, it is log to base two of the number of colours supported.
  779.  
  780.  - Function: display-visual-class &optional display
  781.      This function returns the visual class for the screen.  The value
  782.      is one of the symbols `static-gray', `gray-scale', `static-color',
  783.      `pseudo-color', `true-color', and `direct-color'.
  784.  
  785.  - Function: display-color-cells &optional display
  786.      This function returns the number of color cells the screen
  787.      supports.
  788.  
  789.    These functions obtain additional information specifically about X
  790. displays.
  791.  
  792.  - Function: x-server-version &optional display
  793.      This function returns the list of version numbers of the X server
  794.      running the display.
  795.  
  796.  - Function: x-server-vendor &optional display
  797.      This function returns the vendor that provided the X server
  798.      software.
  799.  
  800. 
  801. File: elisp,  Node: Positions,  Next: Markers,  Prev: Frames,  Up: Top
  802.  
  803. Positions
  804. *********
  805.  
  806.    A "position" is the index of a character in the text of a buffer.
  807. More precisely, a position identifies the place between two characters
  808. (or before the first character, or after the last character), so we can
  809. speak of the character before or after a given position.  However, we
  810. often speak of the character "at" a position, meaning the character
  811. after that position.
  812.  
  813.    Positions are usually represented as integers starting from 1, but
  814. can also be represented as "markers"--special objects that relocate
  815. automatically when text is inserted or deleted so they stay with the
  816. surrounding characters.  *Note Markers::.
  817.  
  818.    See also the "field" feature (*note Fields::), which provides
  819. functions that are used by many cursur-motion commands.
  820.  
  821. * Menu:
  822.  
  823. * Point::         The special position where editing takes place.
  824. * Motion::        Changing point.
  825. * Excursions::    Temporary motion and buffer changes.
  826. * Narrowing::     Restricting editing to a portion of the buffer.
  827.  
  828. 
  829. File: elisp,  Node: Point,  Next: Motion,  Up: Positions
  830.  
  831. Point
  832. =====
  833.  
  834.    "Point" is a special buffer position used by many editing commands,
  835. including the self-inserting typed characters and text insertion
  836. functions.  Other commands move point through the text to allow editing
  837. and insertion at different places.
  838.  
  839.    Like other positions, point designates a place between two characters
  840. (or before the first character, or after the last character), rather
  841. than a particular character.  Usually terminals display the cursor over
  842. the character that immediately follows point; point is actually before
  843. the character on which the cursor sits.
  844.  
  845.    The value of point is a number no less than 1, and no greater than
  846. the buffer size plus 1.  If narrowing is in effect (*note Narrowing::),
  847. then point is constrained to fall within the accessible portion of the
  848. buffer (possibly at one end of it).
  849.  
  850.    Each buffer has its own value of point, which is independent of the
  851. value of point in other buffers.  Each window also has a value of point,
  852. which is independent of the value of point in other windows on the same
  853. buffer.  This is why point can have different values in various windows
  854. that display the same buffer.  When a buffer appears in only one window,
  855. the buffer's point and the window's point normally have the same value,
  856. so the distinction is rarely important.  *Note Window Point::, for more
  857. details.
  858.  
  859.  - Function: point
  860.      This function returns the value of point in the current buffer, as
  861.      an integer.
  862.  
  863.           (point)
  864.                => 175
  865.  
  866.  - Function: point-min
  867.      This function returns the minimum accessible value of point in the
  868.      current buffer.  This is normally 1, but if narrowing is in
  869.      effect, it is the position of the start of the region that you
  870.      narrowed to.  (*Note Narrowing::.)
  871.  
  872.  - Function: point-max
  873.      This function returns the maximum accessible value of point in the
  874.      current buffer.  This is `(1+ (buffer-size))', unless narrowing is
  875.      in effect, in which case it is the position of the end of the
  876.      region that you narrowed to.  (*Note Narrowing::.)
  877.  
  878.  - Function: buffer-end flag
  879.      This function returns `(point-min)' if FLAG is less than 1,
  880.      `(point-max)' otherwise.  The argument FLAG must be a number.
  881.  
  882.  - Function: buffer-size &optional buffer
  883.      This function returns the total number of characters in the current
  884.      buffer.  In the absence of any narrowing (*note Narrowing::),
  885.      `point-max' returns a value one larger than this.
  886.  
  887.      If you specify a buffer, BUFFER, then the value is the size of
  888.      BUFFER.
  889.  
  890.           (buffer-size)
  891.                => 35
  892.           (point-max)
  893.                => 36
  894.  
  895. 
  896. File: elisp,  Node: Motion,  Next: Excursions,  Prev: Point,  Up: Positions
  897.  
  898. Motion
  899. ======
  900.  
  901.    Motion functions change the value of point, either relative to the
  902. current value of point, relative to the beginning or end of the buffer,
  903. or relative to the edges of the selected window.  *Note Point::.
  904.  
  905. * Menu:
  906.  
  907. * Character Motion::       Moving in terms of characters.
  908. * Word Motion::            Moving in terms of words.
  909. * Buffer End Motion::      Moving to the beginning or end of the buffer.
  910. * Text Lines::             Moving in terms of lines of text.
  911. * Screen Lines::           Moving in terms of lines as displayed.
  912. * List Motion::            Moving by parsing lists and sexps.
  913. * Skipping Characters::    Skipping characters belonging to a certain set.
  914.  
  915. 
  916. File: elisp,  Node: Character Motion,  Next: Word Motion,  Up: Motion
  917.  
  918. Motion by Characters
  919. --------------------
  920.  
  921.    These functions move point based on a count of characters.
  922. `goto-char' is the fundamental primitive; the other functions use that.
  923.  
  924.  - Command: goto-char position
  925.      This function sets point in the current buffer to the value
  926.      POSITION.  If POSITION is less than 1, it moves point to the
  927.      beginning of the buffer.  If POSITION is greater than the length
  928.      of the buffer, it moves point to the end.
  929.  
  930.      If narrowing is in effect, POSITION still counts from the
  931.      beginning of the buffer, but point cannot go outside the accessible
  932.      portion.  If POSITION is out of range, `goto-char' moves point to
  933.      the beginning or the end of the accessible portion.
  934.  
  935.      When this function is called interactively, POSITION is the
  936.      numeric prefix argument, if provided; otherwise it is read from the
  937.      minibuffer.
  938.  
  939.      `goto-char' returns POSITION.
  940.  
  941.  - Command: forward-char &optional count
  942.      This function moves point COUNT characters forward, towards the
  943.      end of the buffer (or backward, towards the beginning of the
  944.      buffer, if COUNT is negative).  If the function attempts to move
  945.      point past the beginning or end of the buffer (or the limits of
  946.      the accessible portion, when narrowing is in effect), an error is
  947.      signaled with error code `beginning-of-buffer' or `end-of-buffer'.
  948.  
  949.      In an interactive call, COUNT is the numeric prefix argument.
  950.  
  951.  - Command: backward-char &optional count
  952.      This function moves point COUNT characters backward, towards the
  953.      beginning of the buffer (or forward, towards the end of the
  954.      buffer, if COUNT is negative).  If the function attempts to move
  955.      point past the beginning or end of the buffer (or the limits of
  956.      the accessible portion, when narrowing is in effect), an error is
  957.      signaled with error code `beginning-of-buffer' or `end-of-buffer'.
  958.  
  959.      In an interactive call, COUNT is the numeric prefix argument.
  960.  
  961. 
  962. File: elisp,  Node: Word Motion,  Next: Buffer End Motion,  Prev: Character Motion,  Up: Motion
  963.  
  964. Motion by Words
  965. ---------------
  966.  
  967.    These functions for parsing words use the syntax table to decide
  968. whether a given character is part of a word.  *Note Syntax Tables::.
  969.  
  970.  - Command: forward-word count
  971.      This function moves point forward COUNT words (or backward if
  972.      COUNT is negative).  "Moving one word" means moving until point
  973.      crosses a word-constituent character and then encounters a
  974.      word-separator character.  However, this function cannot move
  975.      point past the boundary of the accessible portion of the buffer,
  976.      or across a field boundary (*note Fields::).  The most common case
  977.      of a field boundary is the end of the prompt in the minibuffer.
  978.  
  979.      If it is possible to move COUNT words, without being stopped
  980.      prematurely by the buffer boundary or a field boundary, the value
  981.      is `t'.  Otherwise, the return value is `nil' and point stops at
  982.      the buffer boundary or field boundary.
  983.  
  984.      If `inhibit-field-text-motion' is non-`nil', this function ignores
  985.      field boundaries.
  986.  
  987.      In an interactive call, COUNT is specified by the numeric prefix
  988.      argument.
  989.  
  990.  - Command: backward-word count
  991.      This function is just like `forward-word', except that it moves
  992.      backward until encountering the front of a word, rather than
  993.      forward.
  994.  
  995.      In an interactive call, COUNT is set to the numeric prefix
  996.      argument.
  997.  
  998.  
  999.  - Variable: words-include-escapes
  1000.      This variable affects the behavior of `forward-word' and everything
  1001.      that uses it.  If it is non-`nil', then characters in the "escape"
  1002.      and "character quote" syntax classes count as part of words.
  1003.      Otherwise, they do not.
  1004.  
  1005.  - Variable: inhibit-field-text-motion
  1006.      If this variable is non-`nil', certain motion functions including
  1007.      `forward-word', `forward-sentence', and `forward-paragraph' ignore
  1008.      field boundaries.
  1009.  
  1010. 
  1011. File: elisp,  Node: Buffer End Motion,  Next: Text Lines,  Prev: Word Motion,  Up: Motion
  1012.  
  1013. Motion to an End of the Buffer
  1014. ------------------------------
  1015.  
  1016.    To move point to the beginning of the buffer, write:
  1017.  
  1018.      (goto-char (point-min))
  1019.  
  1020. Likewise, to move to the end of the buffer, use:
  1021.  
  1022.      (goto-char (point-max))
  1023.  
  1024.    Here are two commands that users use to do these things.  They are
  1025. documented here to warn you not to use them in Lisp programs, because
  1026. they set the mark and display messages in the echo area.
  1027.  
  1028.  - Command: beginning-of-buffer &optional n
  1029.      This function moves point to the beginning of the buffer (or the
  1030.      limits of the accessible portion, when narrowing is in effect),
  1031.      setting the mark at the previous position.  If N is non-`nil',
  1032.      then it puts point N tenths of the way from the beginning of the
  1033.      accessible portion of the buffer.
  1034.  
  1035.      In an interactive call, N is the numeric prefix argument, if
  1036.      provided; otherwise N defaults to `nil'.
  1037.  
  1038.      *Warning:* Don't use this function in Lisp programs!
  1039.  
  1040.  - Command: end-of-buffer &optional n
  1041.      This function moves point to the end of the buffer (or the limits
  1042.      of the accessible portion, when narrowing is in effect), setting
  1043.      the mark at the previous position.  If N is non-`nil', then it
  1044.      puts point N tenths of the way from the end of the accessible
  1045.      portion of the buffer.
  1046.  
  1047.      In an interactive call, N is the numeric prefix argument, if
  1048.      provided; otherwise N defaults to `nil'.
  1049.  
  1050.      *Warning:* Don't use this function in Lisp programs!
  1051.  
  1052. 
  1053. File: elisp,  Node: Text Lines,  Next: Screen Lines,  Prev: Buffer End Motion,  Up: Motion
  1054.  
  1055. Motion by Text Lines
  1056. --------------------
  1057.  
  1058.    Text lines are portions of the buffer delimited by newline
  1059. characters, which are regarded as part of the previous line.  The first
  1060. text line begins at the beginning of the buffer, and the last text line
  1061. ends at the end of the buffer whether or not the last character is a
  1062. newline.  The division of the buffer into text lines is not affected by
  1063. the width of the window, by line continuation in display, or by how
  1064. tabs and control characters are displayed.
  1065.  
  1066.  - Command: goto-line line
  1067.      This function moves point to the front of the LINEth line,
  1068.      counting from line 1 at beginning of the buffer.  If LINE is less
  1069.      than 1, it moves point to the beginning of the buffer.  If LINE is
  1070.      greater than the number of lines in the buffer, it moves point to
  1071.      the end of the buffer--that is, the _end of the last line_ of the
  1072.      buffer.  This is the only case in which `goto-line' does not
  1073.      necessarily move to the beginning of a line.
  1074.  
  1075.      If narrowing is in effect, then LINE still counts from the
  1076.      beginning of the buffer, but point cannot go outside the accessible
  1077.      portion.  So `goto-line' moves point to the beginning or end of the
  1078.      accessible portion, if the line number specifies an inaccessible
  1079.      position.
  1080.  
  1081.      The return value of `goto-line' is the difference between LINE and
  1082.      the line number of the line to which point actually was able to
  1083.      move (in the full buffer, before taking account of narrowing).
  1084.      Thus, the value is positive if the scan encounters the real end of
  1085.      the buffer before finding the specified line.  The value is zero
  1086.      if scan encounters the end of the accessible portion but not the
  1087.      real end of the buffer.
  1088.  
  1089.      In an interactive call, LINE is the numeric prefix argument if one
  1090.      has been provided.  Otherwise LINE is read in the minibuffer.
  1091.  
  1092.  - Command: beginning-of-line &optional count
  1093.      This function moves point to the beginning of the current line.
  1094.      With an argument COUNT not `nil' or 1, it moves forward COUNT-1
  1095.      lines and then to the beginning of the line.
  1096.  
  1097.      This function does not move point across a field boundary (*note
  1098.      Fields::) unless doing so would move beyond there to a different
  1099.      line; therefore, if COUNT is `nil' or 1, and point starts at a
  1100.      field boundary, point does not move.  To ignore field boundaries,
  1101.      either bind `inhibit-field-text-motion' to `t', or use the
  1102.      `forward-line' function instead.  For instance, `(forward-line 0)'
  1103.      does the same thing as `(beginning-of-line)', except that it
  1104.      ignores field boundaries.
  1105.  
  1106.      If this function reaches the end of the buffer (or of the
  1107.      accessible portion, if narrowing is in effect), it positions point
  1108.      there.  No error is signaled.
  1109.  
  1110.  - Function: line-beginning-position &optional count
  1111.      Return the position that `(beginning-of-line COUNT)' would move to.
  1112.  
  1113.  - Command: end-of-line &optional count
  1114.      This function moves point to the end of the current line.  With an
  1115.      argument COUNT not `nil' or 1, it moves forward COUNT-1 lines and
  1116.      then to the end of the line.
  1117.  
  1118.      This function does not move point across a field boundary (*note
  1119.      Fields::) unless doing so would move beyond there to a different
  1120.      line; therefore, if COUNT is `nil' or 1, and point starts at a
  1121.      field boundary, point does not move.  To ignore field boundaries,
  1122.      bind `inhibit-field-text-motion' to `t'.
  1123.  
  1124.      If this function reaches the end of the buffer (or of the
  1125.      accessible portion, if narrowing is in effect), it positions point
  1126.      there.  No error is signaled.
  1127.  
  1128.  - Function: line-end-position &optional count
  1129.      Return the position that `(end-of-line COUNT)' would move to.
  1130.  
  1131.  - Command: forward-line &optional count
  1132.      This function moves point forward COUNT lines, to the beginning of
  1133.      the line.  If COUNT is negative, it moves point -COUNT lines
  1134.      backward, to the beginning of a line.  If COUNT is zero, it moves
  1135.      point to the beginning of the current line.
  1136.  
  1137.      If `forward-line' encounters the beginning or end of the buffer (or
  1138.      of the accessible portion) before finding that many lines, it sets
  1139.      point there.  No error is signaled.
  1140.  
  1141.      `forward-line' returns the difference between COUNT and the number
  1142.      of lines actually moved.  If you attempt to move down five lines
  1143.      from the beginning of a buffer that has only three lines, point
  1144.      stops at the end of the last line, and the value will be 2.
  1145.  
  1146.      In an interactive call, COUNT is the numeric prefix argument.
  1147.  
  1148.  - Function: count-lines start end
  1149.      This function returns the number of lines between the positions
  1150.      START and END in the current buffer.  If START and END are equal,
  1151.      then it returns 0.  Otherwise it returns at least 1, even if START
  1152.      and END are on the same line.  This is because the text between
  1153.      them, considered in isolation, must contain at least one line
  1154.      unless it is empty.
  1155.  
  1156.      Here is an example of using `count-lines':
  1157.  
  1158.           (defun current-line ()
  1159.             "Return the vertical position of point..."
  1160.             (+ (count-lines (window-start) (point))
  1161.                (if (= (current-column) 0) 1 0)
  1162.                -1))
  1163.  
  1164.    Also see the functions `bolp' and `eolp' in *Note Near Point::.
  1165. These functions do not move point, but test whether it is already at the
  1166. beginning or end of a line.
  1167.  
  1168.